import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;

import com.gq.utils.AESCipher;
import com.gq.utils.Base64;


public class Test {

	/**
	 * @param args
	 */
	public static final int BLOCK_SIZE = 32;
	public static final String CIPHER_TRANSFORMATION = "AES/CBC/PKCS5Padding";
	public static final String CIPHER_ALGORITHM = "AES";
	public static byte[] iv;
	private static IvParameterSpec ivSpec;
	
	static {
		iv = new byte[16];
		ivSpec = new IvParameterSpec(iv);
	}
	
	public static String pad(String input) {
		return String.format("%-"+BLOCK_SIZE+"s", input).replace(' ', (char) (BLOCK_SIZE - input.length() % BLOCK_SIZE));
	}
	
	
	public static void main(String[] args) throws Exception {
		AESCipher aesCipher = new AESCipher("longhoanggiang");
		print(aesCipher.encrypt("i love you, em yêu"));
		
		print(aesCipher.decrypt("ZmVkY2JhOTg3NjU0MzIxMOLtbODqOa/NSw6w6+3XBvEZhJWlxfEbZXJCYIXzHEb+"));
	}
	
	public static void print(String s) {
		System.out.println(s);
	}

}
